﻿using Clover.BaseAuth;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Clover.Demo
{
    public class FileCurrentIdentity :DefaultCurrentIdentity
    {
        internal static Dictionary<string, string> Users = new Dictionary<string, string>();
        public override string GetIdentity()
        {
            return Users.ContainsKey(IdentityKey)? Users[IdentityKey]: string.Empty;
        }

        public override void SetIdentity(string Identity)
        {
            if (Users.ContainsKey(IdentityKey))
            {
                Users[IdentityKey] = Identity;
            }
            else {
                Users.Add(IdentityKey, Identity);
            }
        }
    }
}